<?php		
echo $javascript->codeBlock("
$(function() {
		var dates = $('#NewsOnDate').datepicker({
			defaultDate: '+1w',
			dateFormat: 'yy-mm-dd'
		});
	});
",$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));
?>

<?php echo $this->Section->main();?>
<?php echo $this->Html->css(array(HOST.'/news',HOST.'/form',HOST.'/actions'),null,array('inline'=>false));?>
<?php echo $this->Html->script(array(HOST.'/baner',HOST.'/actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>

<div id="content_header">
	<div class="clear">&nbsp;</div>
</div>
<div class="clear"></div>
<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('languages')?>
	</div>
	<div class="grid_2">
		<p><?php //crumbs ?>&nbsp;</p>
	</div>
	<div class="grid_1">
		<?php echo $this->element('search')?>
	</div>	
	<div class="clear">&nbsp;</div>
</div>
<div class="clear"></div>

<div id="content_repeat">
	<div class="grid_1">
		<?php echo $this->element('menu-left');?>
	</div>
	<div class="grid_2">


				<h2>Edytuj wpis</h2>

				<?php
				echo $javascript->link('ckeditor/ckeditor');
				//$config['toolbar'] = array( 
				//    array( 'Bold', 'Italic', 'Underline', 'Strike' ), 
				//    array( 'Image', 'Link', 'Unlink', 'Anchor' ) 
				//); 
				$config['height'] = 400;
				?>
				
				<div class="news form">
				<?php echo $cksource->create(__("News",true),array('url'=>array('plugin'=>'calendar','controller'=>'news','action'=>'edit'),'type' => 'file'));?>

				<table width="100%">
					<tr>
						<td align="left">
				<?php echo $this->Form->input('new_group_id',array('label'=>'Wyswietl wpis w grupie:<br/>','options'=>$newsGroups));?>
						<?php //echo $html->link(__('+ dodaj nowy typ',true),array('plugin'=>'calendar','controller'=>'news','action'=>'add_group'),array('escape'=>false,'onclick'=>"return hs.htmlExpand(this, { objectType: 'iframe' } )"))?>
						</td>
					</tr>
					<tr>
						<td align="left">							
							<?php echo $this->Form->input('on_date',array('label'=>'Data','type'=>'text'));?>
						</td>
					</tr>
					<tr>
						<td>
							<?php echo $this->Form->input('NewUpload.0.file', array('type' => 'file','label'=>__d("calendar","Zdjęcie<br/>",true)));?>
						</td>
					</tr>
				</table>
								
				<?php
					echo $this->Form->input('id');
					echo $this->Form->input('name',array('label'=>__d('calendar','Tytuł',true),'style'=>'width: 100%'));
					echo $this->Form->input('small_content',array('label'=>__d('calendar','Treść do listy',true),'style'=>'width: 100%; height: 60px'));
					echo $cksource->ckeditor('content',array('config'=>$config, 'label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%;'));			
					
				?>
									
					<?php
// 						echo $this->Form->input('id');
// 						echo $this->Form->input('name',array('label'=>__d('calendar','Tytuł',true),'style'=>'width: 100%'));
// 						echo $this->Form->input('small_content',array('label'=>__d('calendar','Treść do listy',true),'style'=>'width: 100%; height: 60px'));
						
// 						echo $cksource->ckeditor('content',array('config'=>$config, 'label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%;'));
// 						echo $this->Form->input('on_date');
// 						echo $this->Form->input('NewUpload.0.file', array('type' => 'file','label'=>__d("calendar","Zdjęcie",true)));
// 						echo $this->Form->input('url',array('label'=>__d('calendar','Adres URL',true),'style'=>'width: 100%'));
// 						echo $this->Form->input('new_group_id',array('label'=>'Type','options'=>$newsGroups));
					?>

				<?php echo $this->Form->end(__('Submit', true));?>
				</div>
				

				
				<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'|| $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'emplo'){?>

				<div class="actions main_actions">
					<ul>
						<li><?php echo $this->Html->link(__('Aktualnosci', true), array('plugin'=>'calendar','controller'=>'news','action'=>'index'),array('escape'=>false,'class'=>'home')); ?></li>
						<li><?php echo $this->Html->link(__('Dodaj', true), 
							array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)')); ?></li>					
						<li><?php echo $this->Html->link(__('Edytuj', true), 
							array('plugin'=>'calendar','controller'=>'news','action'=>'edit',$this->Form->value('News.id')),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_edit.png)')); ?></li>					
						<li><?php echo $this->Html->link(__('Usuń', true), 
							array('plugin'=>'calendar','controller'=>'news','action'=>'delete',$this->Form->value('News.id')),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_delete.png)'),sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('News.name'))); ?></li>					
				
					</ul>
				</div>
				<?php }?>
				 		
 		&nbsp;
	</div>
	<div class="grid_1">
		<?php echo $this->element('menu-right');?>
	</div>	
	<div class="clear">&nbsp;</div>
</div>




